Skip to content

Bind php-fpm to all interfaces by default#63

Merged
baschny merged 1 commit intomasterfrom
fix/php-fpm-listen-all-interfaces
Apr 22, 2026
Merged

Bind php-fpm to all interfaces by default#63
baschny merged 1 commit intomasterfrom
fix/php-fpm-listen-all-interfaces

Conversation

@baschny
Copy link
Copy Markdown
Member

@baschny baschny commented Apr 22, 2026

Problem

After a fresh pull of croneu/phpapp-fpm, other containers can no longer reach php-fpm:

$ telnet php 9000
telnet: Unable to connect to remote host: Connection refused

Inside the php container, php-fpm is bound to 127.0.0.1:9000 instead of 0.0.0.0:9000.

Root cause

The entrypoint has always written listen = 127.0.0.1:9000 into /usr/local/etc/php-fpm.d/www.conf. This used to be harmless because the upstream php:*-fpm image shipped zz-docker.conf with listen = 9000, which — being alphabetically last — overrode our value and bound php-fpm to all interfaces.

Upstream has since moved the listen directive out of zz-docker.conf and into docker.conf:

; docker.conf
; default listen address for easy override in later php-fpm.d/*.conf files
listen = 9000
; zz-docker.conf
[global]
daemonize = no
[www]

Load order is now docker.confwww.confzz-docker.conf, so our www.conf wins with 127.0.0.1:9000 and zz-docker.conf no longer provides an overriding listen. Net effect: php-fpm silently flipped to localhost-only.

Change

Default the pool to listen = 9000 in both the entrypoint template and files/php-fpm-www.conf. Users who want to restrict the bind address can still do so via PHP_FPM_OVERRIDE.


Generated by Oz.

Upstream php:*-fpm moved the listen directive from zz-docker.conf into docker.conf, so our www.conf (written by entrypoint) is now the last file to set listen and its 127.0.0.1:9000 value takes effect. That breaks web->php connectivity in multi-container setups. Default to listen = 9000 so other containers can reach php-fpm; users can still lock it down via PHP_FPM_OVERRIDE.

Co-Authored-By: Oz <oz-agent@warp.dev>
@baschny baschny merged commit aa249a4 into master Apr 22, 2026
4 checks passed
@baschny baschny deleted the fix/php-fpm-listen-all-interfaces branch April 22, 2026 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant